//Seven Segment Decoder from 0 to 9

module a7_decoder (S,H);
    input [3:0]S;
    output [6:0]H;
    
    assign H[0]=(~S[3]&~S[2]&~S[1]&S[0])|(~S[3]&S[2]&~S[1]&~S[0]);
    assign H[1]=(~S[3]&S[2]&~S[1]&S[0])|(~S[3]&S[2]&S[1]&~S[0]);
    assign H[2]=(~S[3]&~S[2]&S[1]&~S[0]);
    assign H[3]=(~S[3]&~S[2]&~S[1]&S[0])|(~S[3]&S[2]&~S[1]&~S[0])|(~S[3]&S[2]&S[1]&S[0])|(S[3]&~S[2]&~S[1]&S[0]);
    assign H[4]=(~S[3]&~S[2]&~S[1]&S[0])|(~S[3]&~S[2]&S[1]&S[0])|(~S[3]&S[2]&~S[1]&~S[0])|(~S[3]&S[2]&~S[1]&S[0])|
                            (~S[3]&S[2]&S[1]&S[0])|(S[3]&~S[2]&~S[1]&S[0]);  //Note: this is part of the line above
   assign H[5]=(~S[3]&~S[2]&~S[1]&S[0])|(~S[3]&~S[2]&S[1]&~S[0])|(~S[3]&~S[2]&S[1]&S[0])|(~S[3]&S[2]&S[1]&S[0]);
    assign H[6]=(~S[3]&~S[2]&~S[1]&~S[0])|(~S[3]&~S[2]&~S[1]&S[0])|(~S[3]&S[2]&S[1]&S[0]);
    
endmodule 
